<script lang="ts" setup>
import PhoneCard from '../base/PhoneCard.vue';
import type { ItemData } from "../../common/type/base";

defineProps<{
    cardTitle: string,
    dataList: ItemData[]
}>();
</script>
<template>
    <div class="activity">
        <h2 class="title">
            {{ cardTitle }}
        </h2>
        <div class="list">
            <div class="item" v-for="(item) in dataList" :key="item.id">
                <phone-card :id="item.id" :price="item.min_price" :imgPath="item.imgurl" :maintitle="item.extension_title"
                    minTitle="首月一元" trendTitle="双十二" :trimFlag="true"></phone-card>
            </div>
        </div>
    </div>
</template>
<style lang="scss" scoped>
.activity {
    margin-bottom: 20px;
    height: 1110px;
    width: 720px;
    background-image: url("../../assets/images/default/activity_bg.jpg");
    background-size: 100% 100%;
    border-radius: 20px;
    overflow: hidden;

    .title {
        margin-top: 18px;
        text-align: center;
        font-size: 40px;
        color: white;
        letter-spacing: 7px;
    }

    .list {
        padding: 15px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 20px;

        .item {
            width: 220px;
            border-radius: 16px;
            background-color: white;
            margin-right: 15px;
            margin-bottom: 15px;
            overflow: hidden;

            &:nth-of-type(3n) {
                margin-right: 0;
            }

        }
    }
}
</style>